package com.qf.service.UserServiceImpl;


import com.qf.mapper.UserMapper;
import com.qf.pojo.User;
import com.qf.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.PostConstruct;
import java.util.ArrayList;
import java.util.List;

/**
 * @author Wy
 * @version V1.0
 * @Project MavenDemo
 * @Package com.qf.service.UserServiceImpl
 * @Description:
 * @Date 2022/6/2 10:09
 */
@Service
public class UserServiceImpl2 implements UserService {

    @Autowired
    private UserMapper userMapper;


    public UserMapper getUserMapper() {
        return userMapper;
    }

    public void setUserMapper(UserMapper userMapper) {
        this.userMapper = userMapper;
    }

    public List<User> findUserAll() {
        List<User> userAll = userMapper.findUserAll();
        return userAll;
    }

     @Transactional
    public void updateUser(User user) {

        userMapper.updateUser(user);

    }

    public void delectUser(Integer id) {
        userMapper.deleteUserById(id);


    }
}
